Repository navigation
harness.layout · docproc - #49
Merged
Merged
Conversation
…0.7.0 Taken through mise run upgrade. The root mise pin for marathon moves 0.24.1 -> 0.25.0; tools/mail takes htmd 0.7.0, whose two new converter options are opt-in, so nothing adapts. MimeKit 5, MsgKit 3.1.0, and typed-path 0.13.0 stay held in their tools' HOLDS; currency reports only those. The marathon pin is a development toolchain pin outside the base module's contract, so the root CHANGELOG takes no entry (as with the 0.24.1 bump); tools/mail's CHANGELOG records htmd under Unreleased.
The check runs four step scripts under scripts/check/ directly: the Go gates per module with GOWORK=off, sqlint over the postgres module (with GOWORK=off), each tool's check and notices, then the lints last (shellcheck over *.sh and the extensionless file tasks, actionlint, the tag-routing test, lint-context, lint-references), every lint running before the step fails. The agent profile: mise.agent.toml includes mise-tasks and .agent/mise-tasks, .claude/settings.json sets MISE_ENV=agent, and the agent tasks check:go, check:sqlint, check:tools, check:lints, test, vet, and lint wrap the step scripts. Without MISE_ENV a person sees check, currency, upgrade, build, fmt, tidy, integration, integration:postgres, integration:storage, and test:integration. Multi-line tasks are file tasks; integration is mise-tasks/integration/_default beside its postgres and storage members. The integration tasks' exit traps are functions, since shellcheck now reads them. build is one line, cmd/docproc into the git-ignored bin/. .gitignore lists .agent/state/ in place of .claude/briefs/. CI's go job runs go.sh and sqlint.sh, its lints job (renamed from lint) lints.sh; no job sets MISE_ENV. The tools, go, and integration path filters add mise-tasks/**, .agent/mise-tasks/**, and (tools and go) scripts/check/**. No step writes go.work.sum: every Go step already ran with GOWORK=off, and neither check nor build reproduced the file.
…asks Each tool's multi-line tasks are file tasks in its own mise-tasks/, under the same names: mail's check, publish, golden, currency, and upgrade; onenote's check, publish, and golden; ooxml's check, publish, currency, golden, and upgrade, which is mise-tasks/upgrade/_default beside the still hidden upgrade:packages. One-line tasks stay inline: mail's mboxrd, onenote's currency and upgrade, ooxml's fixtures. A file task runs in its config root, the tool's directory, as the inline tasks' dir did; each starts set -euo pipefail. tools/envelope has no mise configuration. mail's mise.fixtures.toml is gone: the generator's .NET pin, its env, and its fixtures and tnef tasks (file tasks) live in tools/mail/generator's own mise.toml and mise-tasks/, so mail's check and CI, run from tools/mail, never load .NET. mail's currency and upgrade run the generator's dotnet through mise exec in generator/, and upgrade reads the SDK pin from generator/mise.toml. tools/currency.sh reads the mise tools of the tool's mise.toml and of each subdirectory's mise.toml in place of every mise.<env>.toml, naming a pin by its path under the tool (generator/mise.toml), so upgrade rewrites it there. The lints step's shellcheck covers tools/*/mise-tasks/*, the generator's included. The docs and mail's README name generator/mise.toml in place of MISE_ENV=fixtures.
…ternal; the Go media-name writer goes The stage adapters and the failure classification move from stages into stages/internal/adapter, whose exported API the stages tests drive; stages.Build wires the stages from there, and stages/export_test.go goes. go doc ./stages declares the same identifiers before and after; only the package comment's lines on where the adapters live change. - The adapter types, configs, constructors, the three PDF tool interfaces, Versions, PartErr, and Classify are exported; textStage, sevenZipReader, and exifReader stay unexported, since nothing outside the package names them, and NewTextStage returns a dispatch.Stage. - classify's fault struct goes: Classify returns (content, reason), which the tests drove through export_test.go's wrapper. - The office and picture stages' converters are reached by a Converter method, in place of export_test.go's PictureConverter and OfficeConverter functions. - Each route's required programs move into adapter.Needs, which stages' table reads, so the identities test and Build share one list. - Error and panic messages keep their "stages:" prefix, which a host reads; the panics now name the exported Config types (DocumentConfig.QPDF). - internal/cli's unexported mediaName and its export_test.go go: the Rust envelope owns the writer. TestMediaNames keeps checking every name through ResolveMedium. Test lists for stages and internal/cli are unchanged: 112 untagged, 155 under the integration tag. No CHANGELOG entry: it covers the exported API only.
Every base-module package's tests move, with git mv, into <pkg>/test/ as <pkg>_test, and each package's testdata into <pkg>/test/testdata: 155 test files, the TestMain and integration-tagged suites among them, and twelve testdata trees. Helper packages (tooltest, goldentest, dispatchtest) stay where they are; their own tests move into their test/ directories. - stages' tests split by the API they drive: the ones over Build, Routes, and ParseRoutes (TestParseRoutes, the TestBuild* tests, TestBuiltConfigs, TestClassification, TestClassificationNoBound, TestBuildBounds, TestEveryFixture, TestBuiltIdentities) sit in stages/test; the adapters' (TestStagesPanic, TestClassify among them) in stages/internal/adapter/test, as adapter_test. - What both need, the stand-in of every program a stage runs, their settings, the stand-in office and picture stages, the dispatch helpers, and BuiltSet, is hoisted into stages/internal/stagestest, per the shared-helper rule; both TestMains pass tooltest.Main stagestest.Programs(). - A package reading another's fixtures names them through tooltest.Testdata(t, pkg, elem...), which finds the base module's root as Tools does and fails the test on a missing fixture, in place of ../ paths; the package-level fixture variables become functions of t, since a stand-in process runs the test binary outside the module. - The tools' goldens still go through tooltest.Tools, unchanged: with tools/ absent, every golden test skips naming the tree. tooltest's own TestTools and TestToolsMissingFile fail then, as they did before. - stages' fixture list moves to stages/test/testdata/fixtures.tsv with every base-module path under test/testdata; cmd/docproc's integration harness and its tests read it there. .gitattributes, the testdata READMEs and generators, docs/acceptance.md, docs/design-review.md, docs/packages.md, docs/api.md, and adapter's package comment follow the move. - document's pdfdetach test keys its Attachment literal: vet's composites check no longer treats document as the test's own package. go test -list . ./... names the same tests per module before and after, with and without -tags integration (565 and 677 in the base module). No CHANGELOG entry: no exported API changes.
…c tests into test/; the docs The storage, postgres, and cmd/docproc modules' tests move, with git mv, into <pkg>/test/ as <pkg>_test, fixtures into <pkg>/test/testdata: storage's and postgres's tests with their TestMains and integration-tagged suites, and cmd/docproc's internal/app (with testdata/fallback.txt), internal/apptest, and internal/report (with its golden and rundir testdata). - Left in place: cmd/docproc/integration, the built-binary tier, and cmd/docproc/internal/run's export_test.go (SetBirth, the birth-time probe hook) with file_test.go, the one test using it; run has no other test. git ls-files '*export_test.go' lists only that file. - app's requiredLibrary reads its module's go.mod one directory further up (../../../go.mod); it is the module's own file, not another package's fixture, so it stays a relative path rather than tooltest.Testdata. - stages/test/testdata/fixtures.tsv names cmd/docproc's fixtures at their test/testdata paths. - Docs: docs/development.md gains "Where the tests sit" (test/ placement, the shared helper packages, the module-internal adapters, the two exceptions, the agent's scratch area, pointing to tests-and-docs.md) and states the agent profile and who sees which tasks; docs/packages.md lists stages/internal/adapter and points to the placement; docs/ci.md says which jobs run step scripts and which a person's tasks, none under the agent profile; CLAUDE.md names the agent tasks and the test placement; README's Development line names both; app's package comment names test/graph_test.go; the provider READMEs say test:integration runs them after cmd/docproc's tier too. go test -list . ./... names the same tests per module before and after, GOWORK=off, with and without -tags integration: storage 7/9, postgres 8/28, cmd/docproc 84/88. No CHANGELOG entry: each module's changelog covers its contract alone (exported API, or cmd/docproc's command line, run directory, and exit codes), and none changes.
TestAudioStageReal's closing check that the dispatcher kept its input re-resolved the fixture through tooltest.Testdata, which fails the test itself on a missing file, so the assertion's own message could never be reported; the path is now resolved once and the Stat checks it. The classify test's messages name PartErr, the function they call.
…paration The mail fixture generator's notes, in its source and in the committed manifest.json and truth.json it writes, named the removed fixtures profile (MISE_ENV=fixtures); they name mise -C generator now. The mail README said no tool task loads generator/mise.toml, though currency and upgrade run there. docs/development.md put an agent's scratch tests in .agent/state/, which agent-separation reserves for state; they go in the agent area, .agent/. Two paragraphs rewrapped to 100 columns.
…-parser 1.0.3 Each module's changelog records the task under Unreleased, after go-core's and sqlate's: the base module the test/ placement, the module-internal stage adapters, the removed media-name writer, tooltest.Testdata, the check's step scripts, the agent tasks and profile, build, fmt, tidy, and the file tasks; storage and postgres their test/ placement; cmd/docproc its test/ placement with its two exceptions and build's bin/docproc. The marathon pin takes no entry, as neither precedent records one. tools/onenote's and tools/ooxml's changelogs cover their output contract alone, so their file tasks take no entry; nor does tools/mail's generator move. tools/mail locks mail-parser 1.0.3, taken through its upgrade task. Its fixes are to ISO-2022-JP text with consecutive escape sequences and to its own HTML-to-text conversion, which docproc-mail doesn't use (htmd converts HTML); re-recording the goldens, the ISO-2022-JP fixtures among them, changes none. currency now reports only the held MimeKit, MsgKit, and typed-path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
harness.layout · task 9/17 · docproc
Summary
.agent/state/replaces.claude/briefs/in the ignore lines,MISE_ENV=agentis set in the Claude settings, andmise.agent.tomlis the only mise profile.mise taskslists onlybuild,check,currency,fmt,tidy,upgrade, andthe integration tasks. An agent also sees
check:go,check:sqlint,check:tools,check:lints,test,vet, andlint.call the scripts directly, never under
MISE_ENV=agent.fixturesprofile is now the generator directory's own mise configuration.<pkg>/test/, and test names are unchanged. Two exceptionsstay in place: the command's integration package, and the one
export_test.go, thebirth-time probe hook.
Core changes
stages/internal/adapter: the stage adapters and the failure classification aremodule-internal, and the tests drive the package's exported API. Why: the old
stagesexport_test.goexported ~36 unexported names, which the standard bars.stages' public API(
Build,Options,Set,Lookup,Routes,ParseRoutes,ErrRequest) is unchanged.internal/cli's Go media-name writer is gone. Production never called it; the Rustenvelope owns the writer, and the shared cases still pass through
ResolveMedium.tooltest.Testdata(t, pkg, elem...): a test that reads another package's fixturesresolves the path from the module root and fails on a missing file, instead of using
../.scripts/check/(go.sh,sqlint.sh,tools.sh,lints.sh): shellchecknow covers every file task, and the lints all run before the step fails.
Verify
mise run check: ✓ check: ok, tree clean, nogo.work.sum·mise run test:integration: ✓mise tasksat the docproc root →build check currency fmt integration integration:postgres integration:storage test:integration tidy upgrade.MISE_ENV=agent mise tasks→ the same, pluscheck:go check:lints check:sqlint check:tools lint test vet.mise run check; git status→check: ok, a clean tree, and nogo.work.sum.mise run build; ls bin/→docproc, andgit statusstays clean.git ls-files '*export_test.go'→ onlycmd/docproc/internal/run/export_test.go.mise run currency→ only MimeKit, MsgKit, and typed-path, each marked held, exit 0.mise -C tools/mail/generator tasks→fixturesandtnef;ls tools/mail/mise.fixtures.toml→ not found.
mise run test:integration→ builds the three tools, every packageok, exit 0.Decided without you
stages/internal/stagestesthelper package: the Build tests and the adapter tests sharethe program stand-ins, and the tests-and-docs standard puts such shared helpers in a
<pkg>testpackage.stages:prefix, because a host sees themthrough
stages.Build.lint→lints,check:go (…)→go (…). Themainruleset requiresonly the
cigate.storage,postgres, andcmd/docprocmodules, as core did. The system tools' changelogs, scoped to their outputcontract, record only the dependency bumps. New Decision for later migrations.
mise trustwas run locally fortools/mail/generator/mise.toml. Another checkout trusts itonce; CI never loads it.
Redirects and escalations
goal.
Merge danger: two-way door · blast radius: docproc's tooling, test layout, and CI, plus the
goal record in claude-plugins · docproc: merge waits on CI, which runs the step scripts directly
for the first time · claude-plugins: merge waits on CI
Needs you: none